<!DOCTYPE html>
<html>
	<head lang="en">
		<meta charset="UTF-8">
		<title>12进制时钟特效</title>
		<script type="text/javascript">
			function clock_12h(){
				var today=new Date();
				var yyyy=today.getFullYear();
				var MM=today.getMonth();
				var dd=today.getDate();
				var hh=today.getHours();
				var selfDay="am";
				if(hh>12){
					selfDay="pm";
					hh-=12;
				}
				var mm=today.getMinutes();
				var ss=today.getSeconds();
				var day=today.getDay();
				switch(day){
					case 0:
					day="星期日";
					break;
					case 1:
					day="星期一";
					break;
					case 2:
					day="星期二";
					break;
					case 3:
					day="星期三";
					break;
					case 4:
					day="星期四";
					break;
					case 5:
					day="星期五";
					break;
					case 6:
					day="星期六";
					break;
				}
				document.getElementById("a").innerHTML="你好，欢迎访问贵美商城！<br/>"+yyyy+"年"+(MM+1)+"月"+dd+"日"+"&nbsp;&nbsp;"+hh+":"+mm+":"+ss+"&nbsp;&nbsp;"+selfDay+"&nbsp;&nbsp;"+day;
			}
			var myTime=setInterval("clock_12h()",1000);
		</script>
	</head>
	<body id="a">
		&nbsp;
	</body>
</html>
